package book;

public class BookList {//书架
    private Book[] books = new Book[10]; //可以有10本书 ，但书架有基本跟他无关
    private int shumu;  //记录书架有几本书
    public BookList(){
        this.books[0] = new Book("西游记","吴承恩",45,"小说",false);
        this.books[1] = new Book("三国演义","罗贯中",55,"小说",false);
        this.books[2] = new Book("红楼梦","曹雪芹",46,"小说",false);
        this.shumu = 3;
    }

    public Book[] getBooks(int pos) {  //获取
        return new Book[]{books[pos]};
    }

    public void setBooks(int pos , Book book) {
          books[pos] = book;//修改
    }

    public int getShumu() {
        return shumu;
    }

    public void setShumu(int shumu) {
        this.shumu = shumu;
    }
}
